export const addPointCard = (editor) => {
    const {
        Components
    } = editor;
    Components.addType('addPointCard', {
        model: {
            defaults: {
                name: 'addPointCard',
                droppable: true,
                attributes: {
                    class:'pointer',
                    'data-gjs-type':"addPointCard"
                },
                script() {
                    var thx = document.getElementById(this.attributes.id.value);
                },
                styles: `
                   .pointer{
                    width: 200px;
                    height: 60px;
                    background: linear-gradient(45deg, #04e6fb, #65ff9a);
                    clip-path: polygon(0 0,30px 50%,0 100%,calc(100% - 30px) 100%,100% 50%,calc(100% - 30px) 0);
                    }
                `},
                init() {
                    
                },
        }
    });

    // 注册组件
    editor.BlockManager.add('add-pointCard', {
        label: '指示器卡片',
        category: '卡片类',
        media: `<svg width="30" height="30" xmlns="http://www.w3.org/2000/svg">
 <g>
  <path stroke="#000" id="svg_2" d="m296.50999,211.95496l100.49994,0l33.50004,23.99995l-33.50004,24.00006l-100.49994,0l33.50003,-24.00006l-33.50003,-23.99995z" fill="#fff"/>
 </g>
</svg>`,
        content: {
            type: 'addPointCard'
        },
    });
};